package Student;

import java.util.Scanner;
import java.util.ArrayList;
    public class Studentfuwu {
        Scanner scanner = new Scanner(System.in);
        ArrayList<Studentfuwu> studentList = new ArrayList();

        public void printStudent() {

            for (int i = 0; i < studentList.size(); i++) {
                Studentfuwu student = studentList.get(i);
                //System.out.println(student.getName() + "---" + student.getAge();));
            }
        }

        public void add() {
            System.out.println("请输入学生姓名:");
            String name = scanner.next();
            System.out.println("请输入学生的年龄:");
            int age = scanner.nextInt();
            Studentfuwu student = new Studentfuwu();
            student.setName(name);
            student.setAge(age);
            studentList.add(student);
        }
    }

}
